package ProjetCorba;

/**
 * Interface definition : Colis
 * 
 * @author OpenORB Compiler
 */
public abstract class ColisPOA extends org.omg.PortableServer.Servant
        implements ColisOperations, org.omg.CORBA.portable.InvokeHandler
{
    public Colis _this()
    {
        return ColisHelper.narrow(_this_object());
    }

    public Colis _this(org.omg.CORBA.ORB orb)
    {
        return ColisHelper.narrow(_this_object(orb));
    }

    private static String [] _ids_list =
    {
        "IDL:ProjetCorba/Colis:1.0"
    };

    public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte [] objectId)
    {
        return _ids_list;
    }

    public final org.omg.CORBA.portable.OutputStream _invoke(final String opName,
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler)
    {

        if (opName.equals("_get_numCol")) {
                return _invoke__get_numCol(_is, handler);
        } else if (opName.equals("_get_tarif")) {
                return _invoke__get_tarif(_is, handler);
        } else if (opName.equals("getPrix")) {
                return _invoke_getPrix(_is, handler);
        } else if (opName.equals("getStatus")) {
                return _invoke_getStatus(_is, handler);
        } else if (opName.equals("setPrix")) {
                return _invoke_setPrix(_is, handler);
        } else if (opName.equals("setStatut")) {
                return _invoke_setStatut(_is, handler);
        } else {
            throw new org.omg.CORBA.BAD_OPERATION(opName);
        }
    }

    // helper methods
    private org.omg.CORBA.portable.OutputStream _invoke__get_numCol(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        short arg = numCol();
        _output = handler.createReply();
        _output.write_short(arg);
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke__get_tarif(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        short arg = tarif();
        _output = handler.createReply();
        _output.write_short(arg);
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getStatus(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        short arg0_in = _is.read_short();

        try
        {
            String _arg_result = getStatus(arg0_in);

            _output = handler.createReply();
            _output.write_string(_arg_result);

        }
        catch (ProjetCorba.Col_Inconnu _exception)
        {
            _output = handler.createExceptionReply();
            ProjetCorba.Col_InconnuHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_setStatut(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        String arg0_in = _is.read_string();

        setStatut(arg0_in);

        _output = handler.createReply();

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getPrix(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        float _arg_result = getPrix();

        _output = handler.createReply();
        _output.write_float(_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_setPrix(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        float arg0_in = _is.read_float();

        setPrix(arg0_in);

        _output = handler.createReply();

        return _output;
    }

}
